

#include "..\common\main.h"
#include "..\common\vector3.h"
#include "..\Common\Matrix3x3.h"
using namespace Engine;

App app;


LRESULT CALLBACK Engine::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	switch(uMsg)
	{
		case WM_CLOSE:								// Did We Receive A Close Message?
		{
			PostQuitMessage(0);						// Send A Quit Message
			return 0;								// Jump Back
		}
	}
	return DefWindowProc(hWnd,uMsg,wParam,lParam);
}


void Initialize(HINSTANCE hInstance)
{
	app.mHinstance = hInstance;
	app.mWindow->mWindowRect->left = 0;
	app.mWindow->mWindowRect->right = 640;
	app.mWindow->mWindowRect->top = 0;
	app.mWindow->mWindowRect->bottom = 480;
	app.mWindow->mTitle = new char[25];
	app.mWindow->mTitle = "Color Window";
	app.mWindow->mBits = 16;
	app.mWindow->mFullScreen = false;
	
}

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
	MSG msg;
	BOOL done = FALSE;

	Matrix3x3 m ;
	Matrix3x3 m2 = m *2;
	m = m2;
	



	Initialize(hInstance);

	Engine::CreateGLWindow(hInstance, app);
	ReSizeGLScene(app.mWindow->mWindowRect->right, app.mWindow->mWindowRect->bottom);
	while(!done)
	{
		if(PeekMessage(&msg,NULL,0,0,PM_REMOVE))
		{
			if(msg.message == WM_QUIT)
			{
				done  = TRUE;
			}
			else
			{
				TranslateMessage(&msg);
				DispatchMessage(&msg);
			}
		}
	}

	KillGLWindow(app);
	return msg.wParam;

}




